#============================================================================
-"""Universal(ly) Unique Identifiers (UUIDs).
-"""
+"""Universal Unique Identifiers (UUIDs). By default, UUIDs generated here are
+purely random, with no internal structure. However, they are the same size,
+and are formatted by the same conventions, as the UUIDs in the Open Software
+Foundation's Distributed Computing Environment (OSF DCE). This allows Xend to
+be used with UUIDs generated as per the DCE specification, should that be
+required. These UUIDs are also, by no coincidence, the same size as the
+'handle' stored by the Xen hypervisor along with the domain structure."""
import commands
def toString(u):
- return "-".join(["%02x" * 4] * 4) % tuple(u)
+ return "-".join(["%02x" * 4, "%02x" * 2, "%02x" * 2, "%02x" * 2,
+ "%02x" * 6]) % tuple(u)
def fromString(s):
s = s.replace('-', '')
printk("Xen: DOM %u, flags=%lx refcnt=%d nr_pages=%d "
"xenheap_pages=%d\n", d->domain_id, d->domain_flags,
atomic_read(&d->refcnt), d->tot_pages, d->xenheap_pages);
- printk(" handle=%02x%02x%02x%02x-%02x%02x%02x%02x-"
- "%02x%02x%02x%02x-%02x%02x%02x%02x\n",
+ /* The handle is printed according to the OSF DCE UUID spec., even
+ though it is not necessarily such a thing, for ease of use when it
+ _is_ one of those. */
+ printk(" handle=%02x%02x%02x%02x-%02x%02x-%02x%02x-"
+ "%02x%02x-%02x%02x%02x%02x%02x%02x\n",
d->handle[ 0], d->handle[ 1], d->handle[ 2], d->handle[ 3],
d->handle[ 4], d->handle[ 5], d->handle[ 6], d->handle[ 7],
d->handle[ 8], d->handle[ 9], d->handle[10], d->handle[11],